I am also having the same problem. iPad Pro 10.5 inch on latest software. Smart Keyboard only recently added. Keyboard not working after iPad went to sleep for a little of time.
Very clearly a SW-related bug. If I restart the iPad without moving the keyboard or the iPad an Inch, it worst again.
Hence, the whole disconnect and attach the keyboard hints are no the solution (plus they also don‘t work for me).
This is annyoing. I was using an external bluetooht keyboard from Logitech before. Less beautiful, much more bulky - but working flawlessly, consumed almost no battery and cost only a third of the Smart Keyboard.
Reading through all the HW reports, I have doubts that exchanging the keyboard will solve the issue.
Dear @Apple - is this at least a know error and is someone working on it?
I am rather dissapointed at the moment, but used to such glitches with Apple HW.